﻿using AutoMapper;

namespace ASPApiDemo
{
    public class AutoMapperConfig
    {   //配置创建完成之后不要忘记注入到容器
        public static MapperConfiguration RegisterAutoMapper()
        {
            // 创建AutoMapper配置
            var config = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile<CustomProfile>(); // 添加自定义映射配置
            });
            return config;
        }
    }
}
